Optimal. Leaf size=82 \[ \frac {2 a b \tan ^{-1}\left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2} d}+\frac {\sec (c+d x) (a-b \sin (c+d x))}{\left (a^2-b^2\right ) d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 82, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {2945, 12, 2739,
632, 210} \begin {gather*} \frac {2 a b \text {ArcTan}\left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )}{d \left (a^2-b^2\right )^{3/2}}+\frac {\sec (c+d x) (a-b \sin (c+d x))}{d \left (a^2-b^2\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 210
Rule 632
Rule 2739
Rule 2945
Rubi steps
\begin {align*} \int \frac {\sec (c+d x) \tan (c+d x)}{a+b \sin (c+d x)} \, dx &=\frac {\sec (c+d x) (a-b \sin (c+d x))}{\left (a^2-b^2\right ) d}-\frac {\int \frac {a b}{a+b \sin (c+d x)} \, dx}{-a^2+b^2}\\ &=\frac {\sec (c+d x) (a-b \sin (c+d x))}{\left (a^2-b^2\right ) d}+\frac {(a b) \int \frac {1}{a+b \sin (c+d x)} \, dx}{a^2-b^2}\\ &=\frac {\sec (c+d x) (a-b \sin (c+d x))}{\left (a^2-b^2\right ) d}+\frac {(2 a b) \text {Subst}\left (\int \frac {1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{\left (a^2-b^2\right ) d}\\ &=\frac {\sec (c+d x) (a-b \sin (c+d x))}{\left (a^2-b^2\right ) d}-\frac {(4 a b) \text {Subst}\left (\int \frac {1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac {1}{2} (c+d x)\right )\right )}{\left (a^2-b^2\right ) d}\\ &=\frac {2 a b \tan ^{-1}\left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2} d}+\frac {\sec (c+d x) (a-b \sin (c+d x))}{\left (a^2-b^2\right ) d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.13, size = 151, normalized size = 1.84 \begin {gather*} \frac {2 a b \tan ^{-1}\left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right ) \cos (c+d x)+\sqrt {a^2-b^2} (a-a \cos (c+d x)-b \sin (c+d x))}{(a-b) (a+b) \sqrt {a^2-b^2} d \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.22, size = 111, normalized size = 1.35
method | result | size |
derivativedivides | \(\frac {-\frac {4}{\left (4 a +4 b \right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {4}{\left (4 a -4 b \right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {2 a b \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{\left (a -b \right ) \left (a +b \right ) \sqrt {a^{2}-b^{2}}}}{d}\) | \(111\) |
default | \(\frac {-\frac {4}{\left (4 a +4 b \right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {4}{\left (4 a -4 b \right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {2 a b \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{\left (a -b \right ) \left (a +b \right ) \sqrt {a^{2}-b^{2}}}}{d}\) | \(111\) |
risch | \(\frac {2 i \left (i a \,{\mathrm e}^{i \left (d x +c \right )}+b \right )}{d \left (-a^{2}+b^{2}\right ) \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {i b a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i \left (\sqrt {a^{2}-b^{2}}\, a -a^{2}+b^{2}\right )}{b \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right ) \left (a -b \right ) d}+\frac {i b a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i \left (\sqrt {a^{2}-b^{2}}\, a +a^{2}-b^{2}\right )}{b \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right ) \left (a -b \right ) d}\) | \(209\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.39, size = 308, normalized size = 3.76 \begin {gather*} \left [\frac {\sqrt {-a^{2} + b^{2}} a b \cos \left (d x + c\right ) \log \left (-\frac {{\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2} - 2 \, {\left (a \cos \left (d x + c\right ) \sin \left (d x + c\right ) + b \cos \left (d x + c\right )\right )} \sqrt {-a^{2} + b^{2}}}{b^{2} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2}}\right ) + 2 \, a^{3} - 2 \, a b^{2} - 2 \, {\left (a^{2} b - b^{3}\right )} \sin \left (d x + c\right )}{2 \, {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} d \cos \left (d x + c\right )}, -\frac {\sqrt {a^{2} - b^{2}} a b \arctan \left (-\frac {a \sin \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \cos \left (d x + c\right )}\right ) \cos \left (d x + c\right ) - a^{3} + a b^{2} + {\left (a^{2} b - b^{3}\right )} \sin \left (d x + c\right )}{{\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} d \cos \left (d x + c\right )}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sin {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{a + b \sin {\left (c + d x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.46, size = 106, normalized size = 1.29 \begin {gather*} \frac {2 \, {\left (\frac {{\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (a\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )\right )} a b}{{\left (a^{2} - b^{2}\right )}^{\frac {3}{2}}} + \frac {b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a}{{\left (a^{2} - b^{2}\right )} {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}}\right )}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 12.02, size = 151, normalized size = 1.84 \begin {gather*} \frac {2\,a\,b\,\mathrm {atan}\left (\frac {\frac {a\,b\,\left (2\,a^2\,b-2\,b^3\right )}{{\left (a+b\right )}^{3/2}\,{\left (a-b\right )}^{3/2}}+\frac {2\,a^2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )}{{\left (a+b\right )}^{3/2}\,{\left (a-b\right )}^{3/2}}}{2\,a\,b}\right )}{d\,{\left (a+b\right )}^{3/2}\,{\left (a-b\right )}^{3/2}}-\frac {\frac {2\,a}{a^2-b^2}-\frac {2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a^2-b^2}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________